package com.stripe.input.util;

import java.util.Arrays;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * File: ObjectUtils
 * Author: 82149 Create: 2019/8/9 16:09
 * Changes (from 2019/8/9)
 * --------------------------------------------------
 * describe:
 * ---------------------------------------------------
 */
public final class ObjectUtils {
    public static boolean equals(@Nullable Object obj1, @Nullable Object obj2) {
        return (obj1 == obj2) || (obj1 != null && obj1.equals(obj2));
    }

    public static int hash(@Nullable Object... values) {
        return Arrays.hashCode(values);
    }

    @NonNull
    public static <T> T getOrDefault(@Nullable T obj, @NonNull T defaultValue) {
        return obj != null ? obj : defaultValue;
    }
}
